
<template>
  <div>
    <router-view></router-view>
    <div class="fly bg-fly-circle1"></div>
    <div class="fly bg-fly-circle2"></div>
    <div class="fly bg-fly-circle3"></div>
    <div class="fly bg-fly-circle4"></div>
  </div>
</template>

<script lang="ts">
import { defineComponent, onMounted } from "vue";
import { useStore } from "vuex";

export default defineComponent({
  name: "App",

  setup() {
    const store = useStore();

    onMounted(() => {
      document.onkeyup = function (e) {//按下空格 播放/暂停音乐
        if (e.code === "Space") {
          store.dispatch("changePlayState");
          e.preventDefault();
        }
      };
      // document.body.onkeydown = function (event) {//禁止按下空格时页面滚动的默认事件
      //   var e = window.event || event;
      //   if (e.preventDefault) {
      //     e.preventDefault();
      //   } else {
      //     window.event.returnValue = false;
      //   }
      // };
    });
  },

});
</script>


<style lang="scss" scoped>
    @import "./assets/css/app.scss";
</style>
